﻿using Inkubator.Wizard.WebWizard.WizardUtilities;

namespace Inkubator.Wizard.WebWizard.WizardControl
{
    public class ActionWizard
    {
        /// <summary>
        /// AssemblyName represent the name of the DLL/EXE to be executed.
        /// </summary>
        private string assemblyName;
        /// <summary>
        /// Method represent the Method from the Assembly selected to be executed.
        /// </summary>
        private string method;
        /// <summary>
        /// ImpInterface represent the Interface that this Assembly implement.
        /// </summary>
        private string impInterface;

        public ActionWizard(string assemblyName, string method, string impInterface)
        {
            this.assemblyName = "C:\\diego\\programacion\\library-inkubator\\inkubator\\MagicWiz\\Wizard\\Bin\\"+assemblyName;
            this.method = method;
            this.impInterface = impInterface;
        }

        /// <summary>
        /// Execute the DLL/EXE.
        /// </summary>
        /// <param name="arguments"></param>
        public void execute(object[] arguments)
        {
            ActionInvoker.invokeProcess(assemblyName, method, impInterface, arguments);
        }

        /// <summary>
        /// Execute the DLL/EXE and return a boolean value with the result.
        /// </summary>
        /// <param name="arguments"></param>
        /// <returns></returns>
        public bool evaluate(object[] arguments)
        {
            return ActionInvoker.evaluateProcess(assemblyName, method, impInterface, arguments);
        }

    }
}
